// components/tab/tab.js
Component({

  /**
   * 页面的初始数据
   */
  data: {
    current: 0
  },

  properties: {
    list: Array
  },

  methods: {
    onTabHighLight: function (e) {
      const { currentTarget: { dataset: { index, type } } } = e
      this.setData({
        current: index
      })

      this.triggerEvent('onChange', { index, type })
    }
  }
})